package com.synergy.stockflow.sales.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.synergy.stockflow.warehouse.entity.Warehouse;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

@Schema
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "shipment_history")
public class ShipmentHistory {
    /**
     * 出库记录编码
     */
    @TableId(value = "shipment_history_id", type = IdType.ASSIGN_ID)
    @Schema(description="出库记录编码")
    private String shipmentHistoryId;

    /**
     * 订单编码
     */
    @TableField(value = "shipment_history_quotation_id")
    @Schema(description="订单编码")
    private String shipmentHistoryQuotationId;

    /**
     * 出库仓库
     */
    @TableField(value = "shipment_history_outbound_warehouse")
    @Schema(description="出库仓库")
    private String shipmentHistoryOutboundWarehouse;

    /**
     * 出库总数量
     */
    @TableField(value = "shipment_history_outbound_quantity")
    @Schema(description="出库总数量")
    private BigDecimal shipmentHistoryOutboundQuantity;

    /**
     * 出库总重量
     */
    @TableField(value = "shipment_history_outbound_weight")
    @Schema(description="出库总重量")
    private BigDecimal shipmentHistoryOutboundWeight;

    /**
     * 出库总额
     */
    @TableField(value = "shipment_history_total")
    @Schema(description="出库总额")
    private BigDecimal shipmentHistoryTotal;

    /**
     * 确认出库
     */
    @TableField(value = "shipment_history_confirm")
    @Schema(description="确认出库")
    private String shipmentHistoryConfirm;

    /**
     * 出库时间
     */
    @TableField(value = "shipment_history_outbound_time")
    @Schema(description="出库时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date shipmentHistoryOutboundTime;

    /**
     * 预计出库时间
     */
    @TableField(value = "shipment_history_estimated_outbound_time")
    @Schema(description="预计出库时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date shipmentHistoryEstimatedOutboundTime;

    /**
     * 出库员编码
     */
    @TableField(value = "shipment_history_outbound_clerk")
    @Schema(description="出库员编码")
    private String shipmentHistoryOutboundClerk;

    /**
     * 确认收货
     */
    @TableField(value = "shipment_history_confirm_receipt")
    @Schema(description="确认收货")
    private String shipmentHistoryConfirmReceipt;

    /**
     * 收货时间
     */
    @TableField(value = "shipment_history_receipt_time")
    @Schema(description="收货时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date shipmentHistoryReceiptTime;

    @TableField(exist = false)
    @Schema(description="员工姓名")
    private String nickname;

    /**
     * 发货详情
     */
    @TableField(exist = false)
    @Schema(description="发货详情")
    private List<ShippingDetails> shippingDetailsList;

    @TableField(exist = false)
    @Schema(description="仓库")
    private Warehouse warehouse;
}